// import 'package:connectycube_flutter_call_kit/connectycube_flutter_call_kit.dart';
import 'package:flutter/material.dart';
import 'package:nylo_framework/nylo_framework.dart';
import '/app/controllers/call_controller.dart';

/**
 * 呼叫
 */
class CallPage extends NyStatefulWidget<CallController> {
  static const path = '/call';

  CallPage() : super(path, child: _CallPageState());
}

class _CallPageState extends NyState<CallPage> {

  @override
  init() async {
    super.init();
    // ConnectycubeFlutterCallKit.instance.init(
    //   onCallAccepted: _onCallAccepted,
    //   onCallRejected: _onCallRejected,
    // );
    // CallEvent callEvent = CallEvent(
    //   sessionId: 'uuid',
    //   callType: 1,
    //   callerId: 123,
    //   opponentsIds: {1,2},
    //   callerName: 'callerName',
    //   callPhoto: 'callerAvatar',
    //   userInfo: {'name':'dasda'},
    // );
    //
    // ConnectycubeFlutterCallKit.showCallNotification(callEvent);
    //
    // ConnectycubeFlutterCallKit.reportCallAccepted(sessionId:'1234');
    // ConnectycubeFlutterCallKit.reportCallEnded(sessionId:'1234');
  }

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text("Call")
      ),
      body: SafeArea(
         child: Container(),
      ),
    );
  }

  // Future<void> _onCallAccepted(CallEvent callEvent) async {}
  //
  // Future<void> _onCallRejected(CallEvent callEvent) async {}

}
